package com.xjtu.controller.admin;

import com.xjtu.result.Result;
import com.xjtu.service.ReportService;
import com.xjtu.vo.Report.ReportVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RestController
@RequestMapping("/admin/report")
@Api(tags = "统计数据接口")
@Slf4j
public class ReportController {
    @Autowired
    ReportService reportService;

    @GetMapping("temperature")
    @ApiOperation("查询某老人近5天体温")
    public Result<ReportVo> getDaliyTemperature(@RequestParam(required = true) int elderlyId) {
        Result result = reportService.getTemperature(elderlyId);
        return  result;
    }

    @GetMapping("pulseRate")
    @ApiOperation("查询某老人近5天心率")
    public Result<ReportVo> getDaliypaluseRate(@RequestParam(required = true) int elderlyId) {
        Result result = reportService.getPulseRate(elderlyId);
        return  result;
    }
}
